<?php echo $this->Html->css(array('ogloszenia.index','form'),null,array('inline'=>false));?>

<div id="left-panel">
	<div id="logo"><?php echo $this->Html->link($this->Html->image('logo.png'),'/',array('escape'=>false,'alt'=>'strzyzowianin.pl'))?></div>
	<h2><?php echo __('ogłoszenia')?></h2>
	<ul>
		<?php echo $this->element('menu-ogloszenia')?>
	</ul>
	
</div>
<div id="right-panel">
	<?php echo $this->element('search_statusy')?>
	<div class="clear"></div>
	<?php echo $this->Form->create('Ogloszenia',array('url'=>array('controller'=>'main_app','action'=>'statusy')));?>
	<table cellpadding="0" cellspacing="0" class="index">
	<tr>
		<td><?php echo __('Sortuj wg.:',true)?> <?php echo $this->Paginator->sort('name');?>, <?php echo $this->Paginator->sort('content');?>, <?php echo $this->Paginator->sort('created');?></td>
		<td><div class="submit"><input type="submit" value="Zapisz"/></div></td>
	</tr>
	<?php
	$i = 0;
	$j = 0;
	foreach ($ogloszenias as $ogloszenia):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td width="90%">
			<h4><?php echo $this->Html->link($ogloszenia['Ogloszenia']['name'], array('action' => 'view', $ogloszenia['Ogloszenia']['slug'])); ?>&nbsp;</h4>			
			<?php echo $this->Text->truncate($ogloszenia['Ogloszenia']['content'],300,array('ending' => '...','exact' => false,'html' => true)); ?>&nbsp;
			<div class="informacje-dodatkowe">
				<?php echo $this->Html->link(__('Zobacz', true), array('action' => 'view', $ogloszenia['Ogloszenia']['slug'])); ?>
				 | <?php __('Dodano')?>: <?php echo $this->Time->timeFormaPL( $format = 'l j F Y', $ogloszenia['Ogloszenia']['modified'])?>  
			</div>
		</td>
		<td valign="middle">
			<?php echo $this->Form->hidden('Ogloszenia.'.$j.'.id',array('value'=>$ogloszenia['Ogloszenia']['id']))?>
			<?php echo $this->Form->radio('Ogloszenia.'.$j.'.status',array(0=>$this->Html->image('zablokowany.png',array('align'=>'middle','alt'=>__('zablogowany',true))),1=>$this->Html->image('statusy.png',array('align'=>'middle','alt'=>__('aktywny',true)))),array('legend'=>false,'value'=>$ogloszenia['Ogloszenia']['status']))?>
		</td>
	</tr>
	<?php $j++; ?>
<?php endforeach; ?>
	<tr>
		<td>&nbsp;</td>
		<td><div class="submit"><input type="submit" value="Zapisz"/></div></td>
	</tr>
	</table>
	<?php echo $this->Form->end();?>
	
	<?php echo $this->element('stronicowanie')?>
</div>
